package easybooking.report;

import java.io.Serializable;

/**
 * Column of a <code>Row</code>-object. <code>Column</code>-objects
 * implement the interface <code>Serializable</code>, thus they can for example transferred as
 * copy from the server to the client.
 *
 * @see Row
 * @author Hakan Keles
 */
public class Column implements Serializable {

    /**
     * The value of a column object equates to a cell entry of a table.
     * Here this entry has a simple String format.
     */
    private String value = "";

    /**
     * Constructor, which enforces the declaration of a value(column entry).
     * @param s the value, which should presented through the column object.
     */
    public Column(String s) {
        this.value = s;
    }

    /**
     * Read-out the column entry.
     *
     * @return Returns a String
     */
    public String getValue() {
        return value;
    }

    /**
     * Overwrite the current column value.
     *
     * @param value The new column value as a String.
     */
    public void setValue(String value) {
        this.value = value;
    }

    /**
     * Change the <code>Column</code>-object to a String.
     *
     * @return returns the column as string
     * @see java.lang.Object
     */
    @Override
    public String toString() {
        return this.value;
    }
}
